package org.sport.model.entityModel;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Collection;

/**
 * Created by Allen on 2017/9/29.
 */
@Entity
@Table(name = "usertable", schema = "sportinfo", catalog = "")
public class UsertableEntity {
    private String name;
    private String password;
    private String email;
    private String phoneNumber;
    private String brief;
    private String headIcon;
    private String idCardNumber;
    private Timestamp birthday;
    private Timestamp createDay;
    private Integer awardNumber;
    private Integer punchNumber;
    private Integer punchToday;
    private String privateInfoTab;
    private String sportHisTab;
    private String contentPersonTab;
    private String pubActTab;
    private String awardTab;
    private String parActTab;
    private int id;
    private Collection<ActivitytableEntity> activitytablesById;
    private Collection<ActlinuserEntity> actlinusersById;
    private Collection<AwardtableEntity> awardtablesById;
    private Collection<DiscusstableEntity> discusstablesById;
    private Collection<GrouplinkuserEntity> grouplinkusersById;
    private Collection<GrouptableEntity> grouptablesById;
    private Collection<HistoryinfotableEntity> historyinfotablesById;
    private Collection<LinkapplyhistoryEntity> linkapplyhistoriesById;
    private Collection<LinkmantableEntity> linkmantablesById;
    private Collection<ParacttableEntity> paracttablesById;
    private Collection<SporthistorytableEntity> sporthistorytablesById;
    private Collection<UserinfohistorytableEntity> userinfohistorytablesById;
    private Collection<UserprivatetableEntity> userprivatetablesById;

    @Basic
    @Column(name = "name", nullable = true, length = 45)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "password", nullable = true, length = 45)
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Basic
    @Column(name = "email", nullable = true, length = 45)
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Basic
    @Column(name = "phoneNumber", nullable = true, length = 45)
    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    @Basic
    @Column(name = "brief", nullable = true, length = 45)
    public String getBrief() {
        return brief;
    }

    public void setBrief(String brief) {
        this.brief = brief;
    }

    @Basic
    @Column(name = "headIcon", nullable = true, length = 45)
    public String getHeadIcon() {
        return headIcon;
    }

    public void setHeadIcon(String headIcon) {
        this.headIcon = headIcon;
    }

    @Basic
    @Column(name = "idCardNumber", nullable = true, length = 45)
    public String getIdCardNumber() {
        return idCardNumber;
    }

    public void setIdCardNumber(String idCardNumber) {
        this.idCardNumber = idCardNumber;
    }

    @Basic
    @Column(name = "birthday", nullable = true)
    public Timestamp getBirthday() {
        return birthday;
    }

    public void setBirthday(Timestamp birthday) {
        this.birthday = birthday;
    }

    @Basic
    @Column(name = "createDay", nullable = true)
    public Timestamp getCreateDay() {
        return createDay;
    }

    public void setCreateDay(Timestamp createDay) {
        this.createDay = createDay;
    }

    @Basic
    @Column(name = "awardNumber", nullable = true)
    public Integer getAwardNumber() {
        return awardNumber;
    }

    public void setAwardNumber(Integer awardNumber) {
        this.awardNumber = awardNumber;
    }

    @Basic
    @Column(name = "punchNumber", nullable = true)
    public Integer getPunchNumber() {
        return punchNumber;
    }

    public void setPunchNumber(Integer punchNumber) {
        this.punchNumber = punchNumber;
    }

    @Basic
    @Column(name = "punchToday", nullable = true)
    public Integer getPunchToday() {
        return punchToday;
    }

    public void setPunchToday(Integer punchToday) {
        this.punchToday = punchToday;
    }

    @Basic
    @Column(name = "privateInfoTab", nullable = true, length = 45)
    public String getPrivateInfoTab() {
        return privateInfoTab;
    }

    public void setPrivateInfoTab(String privateInfoTab) {
        this.privateInfoTab = privateInfoTab;
    }

    @Basic
    @Column(name = "sportHisTab", nullable = true, length = 45)
    public String getSportHisTab() {
        return sportHisTab;
    }

    public void setSportHisTab(String sportHisTab) {
        this.sportHisTab = sportHisTab;
    }

    @Basic
    @Column(name = "contentPersonTab", nullable = true, length = 45)
    public String getContentPersonTab() {
        return contentPersonTab;
    }

    public void setContentPersonTab(String contentPersonTab) {
        this.contentPersonTab = contentPersonTab;
    }

    @Basic
    @Column(name = "pubActTab", nullable = true, length = 45)
    public String getPubActTab() {
        return pubActTab;
    }

    public void setPubActTab(String pubActTab) {
        this.pubActTab = pubActTab;
    }

    @Basic
    @Column(name = "awardTab", nullable = true, length = 45)
    public String getAwardTab() {
        return awardTab;
    }

    public void setAwardTab(String awardTab) {
        this.awardTab = awardTab;
    }

    @Basic
    @Column(name = "parActTab", nullable = true, length = 45)
    public String getParActTab() {
        return parActTab;
    }

    public void setParActTab(String parActTab) {
        this.parActTab = parActTab;
    }

    @Id
    @Column(name = "_id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UsertableEntity that = (UsertableEntity) o;

        if (id != that.id) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (password != null ? !password.equals(that.password) : that.password != null) return false;
        if (email != null ? !email.equals(that.email) : that.email != null) return false;
        if (phoneNumber != null ? !phoneNumber.equals(that.phoneNumber) : that.phoneNumber != null) return false;
        if (brief != null ? !brief.equals(that.brief) : that.brief != null) return false;
        if (headIcon != null ? !headIcon.equals(that.headIcon) : that.headIcon != null) return false;
        if (idCardNumber != null ? !idCardNumber.equals(that.idCardNumber) : that.idCardNumber != null) return false;
        if (birthday != null ? !birthday.equals(that.birthday) : that.birthday != null) return false;
        if (createDay != null ? !createDay.equals(that.createDay) : that.createDay != null) return false;
        if (awardNumber != null ? !awardNumber.equals(that.awardNumber) : that.awardNumber != null) return false;
        if (punchNumber != null ? !punchNumber.equals(that.punchNumber) : that.punchNumber != null) return false;
        if (punchToday != null ? !punchToday.equals(that.punchToday) : that.punchToday != null) return false;
        if (privateInfoTab != null ? !privateInfoTab.equals(that.privateInfoTab) : that.privateInfoTab != null)
            return false;
        if (sportHisTab != null ? !sportHisTab.equals(that.sportHisTab) : that.sportHisTab != null) return false;
        if (contentPersonTab != null ? !contentPersonTab.equals(that.contentPersonTab) : that.contentPersonTab != null)
            return false;
        if (pubActTab != null ? !pubActTab.equals(that.pubActTab) : that.pubActTab != null) return false;
        if (awardTab != null ? !awardTab.equals(that.awardTab) : that.awardTab != null) return false;
        if (parActTab != null ? !parActTab.equals(that.parActTab) : that.parActTab != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = name != null ? name.hashCode() : 0;
        result = 31 * result + (password != null ? password.hashCode() : 0);
        result = 31 * result + (email != null ? email.hashCode() : 0);
        result = 31 * result + (phoneNumber != null ? phoneNumber.hashCode() : 0);
        result = 31 * result + (brief != null ? brief.hashCode() : 0);
        result = 31 * result + (headIcon != null ? headIcon.hashCode() : 0);
        result = 31 * result + (idCardNumber != null ? idCardNumber.hashCode() : 0);
        result = 31 * result + (birthday != null ? birthday.hashCode() : 0);
        result = 31 * result + (createDay != null ? createDay.hashCode() : 0);
        result = 31 * result + (awardNumber != null ? awardNumber.hashCode() : 0);
        result = 31 * result + (punchNumber != null ? punchNumber.hashCode() : 0);
        result = 31 * result + (punchToday != null ? punchToday.hashCode() : 0);
        result = 31 * result + (privateInfoTab != null ? privateInfoTab.hashCode() : 0);
        result = 31 * result + (sportHisTab != null ? sportHisTab.hashCode() : 0);
        result = 31 * result + (contentPersonTab != null ? contentPersonTab.hashCode() : 0);
        result = 31 * result + (pubActTab != null ? pubActTab.hashCode() : 0);
        result = 31 * result + (awardTab != null ? awardTab.hashCode() : 0);
        result = 31 * result + (parActTab != null ? parActTab.hashCode() : 0);
        result = 31 * result + id;
        return result;
    }

    @OneToMany(mappedBy = "usertableByOwnerId")
    public Collection<ActivitytableEntity> getActivitytablesById() {
        return activitytablesById;
    }

    public void setActivitytablesById(Collection<ActivitytableEntity> activitytablesById) {
        this.activitytablesById = activitytablesById;
    }

    @OneToMany(mappedBy = "usertableByUserId")
    public Collection<ActlinuserEntity> getActlinusersById() {
        return actlinusersById;
    }

    public void setActlinusersById(Collection<ActlinuserEntity> actlinusersById) {
        this.actlinusersById = actlinusersById;
    }

    @OneToMany(mappedBy = "usertableByUserId")
    public Collection<AwardtableEntity> getAwardtablesById() {
        return awardtablesById;
    }

    public void setAwardtablesById(Collection<AwardtableEntity> awardtablesById) {
        this.awardtablesById = awardtablesById;
    }

    @OneToMany(mappedBy = "usertableByUserId")
    public Collection<DiscusstableEntity> getDiscusstablesById() {
        return discusstablesById;
    }

    public void setDiscusstablesById(Collection<DiscusstableEntity> discusstablesById) {
        this.discusstablesById = discusstablesById;
    }

    @OneToMany(mappedBy = "usertableByUserId")
    public Collection<GrouplinkuserEntity> getGrouplinkusersById() {
        return grouplinkusersById;
    }

    public void setGrouplinkusersById(Collection<GrouplinkuserEntity> grouplinkusersById) {
        this.grouplinkusersById = grouplinkusersById;
    }

    @OneToMany(mappedBy = "usertableByOwnerId")
    public Collection<GrouptableEntity> getGrouptablesById() {
        return grouptablesById;
    }

    public void setGrouptablesById(Collection<GrouptableEntity> grouptablesById) {
        this.grouptablesById = grouptablesById;
    }

    @OneToMany(mappedBy = "usertableByUserId")
    public Collection<HistoryinfotableEntity> getHistoryinfotablesById() {
        return historyinfotablesById;
    }

    public void setHistoryinfotablesById(Collection<HistoryinfotableEntity> historyinfotablesById) {
        this.historyinfotablesById = historyinfotablesById;
    }

    @OneToMany(mappedBy = "usertableByApplyUserId")
    public Collection<LinkapplyhistoryEntity> getLinkapplyhistoriesById() {
        return linkapplyhistoriesById;
    }

    public void setLinkapplyhistoriesById(Collection<LinkapplyhistoryEntity> linkapplyhistoriesById) {
        this.linkapplyhistoriesById = linkapplyhistoriesById;
    }

    @OneToMany(mappedBy = "usertableByUserId")
    public Collection<LinkmantableEntity> getLinkmantablesById() {
        return linkmantablesById;
    }

    public void setLinkmantablesById(Collection<LinkmantableEntity> linkmantablesById) {
        this.linkmantablesById = linkmantablesById;
    }

    @OneToMany(mappedBy = "usertableByUserId")
    public Collection<ParacttableEntity> getParacttablesById() {
        return paracttablesById;
    }

    public void setParacttablesById(Collection<ParacttableEntity> paracttablesById) {
        this.paracttablesById = paracttablesById;
    }

    @OneToMany(mappedBy = "usertableByUserId")
    public Collection<SporthistorytableEntity> getSporthistorytablesById() {
        return sporthistorytablesById;
    }

    public void setSporthistorytablesById(Collection<SporthistorytableEntity> sporthistorytablesById) {
        this.sporthistorytablesById = sporthistorytablesById;
    }

    @OneToMany(mappedBy = "usertableByUserId")
    public Collection<UserinfohistorytableEntity> getUserinfohistorytablesById() {
        return userinfohistorytablesById;
    }

    public void setUserinfohistorytablesById(Collection<UserinfohistorytableEntity> userinfohistorytablesById) {
        this.userinfohistorytablesById = userinfohistorytablesById;
    }

    @OneToMany(mappedBy = "usertableByUserId")
    public Collection<UserprivatetableEntity> getUserprivatetablesById() {
        return userprivatetablesById;
    }

    public void setUserprivatetablesById(Collection<UserprivatetableEntity> userprivatetablesById) {
        this.userprivatetablesById = userprivatetablesById;
    }
}
